package com.briup.myblog.web.controller;

import com.briup.myblog.aop.Logging;
import com.briup.myblog.bean.basic.BaseLog;
import com.briup.myblog.service.IBaseLogService;
import com.briup.myblog.utils.Result;
import com.briup.myblog.utils.ResultUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(tags = "日志模块")
@RestController
public class LogController {
        @Autowired
        private IBaseLogService service;

        @ApiOperation("分页日志查询")
        @ApiImplicitParams({
                @ApiImplicitParam(name="pageNum",value = "当前页码",required = true),
                @ApiImplicitParam(name="pageSize",value = "页码大小",required = true)
        })

        @Logging
        @GetMapping("/auth/log/pageQuery")
        public Result pageQuery(Integer pageSize, Integer pageNum){
                PageInfo<BaseLog> page = service.pageQuery(pageSize, pageNum);
                return ResultUtil.success(page);
        }
}
